import type { RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'Layout',
    redirect: '/home',
    component: () => import('../layouts/MainLayout.vue'),
    children: [
      {
        path: '/home',
        name: 'Home',
        component: () => import('../pages/IndexPage.vue')
      },
      {
        path: '/board/device',
        name: 'Device',
        component: () => import('../pages/board/connection/Index.vue')
      },
      {
        path: '/board/map',
        name: 'Map',
        component: () => import('../pages/board/map/Index.vue')
      },
      {
        path: '/monitor/graph',
        name: 'Graph',
        component: () => import('../pages/monitor/graph/Index.vue')
      },
      {
        path: '/monitor/table',
        name: 'MonitorTable',
        component: () => import('../pages/monitor/table/Index.vue')
      },
      {
        path: '/sheet/chart',
        name: 'SheetChart',
        component: () => import('../pages/sheet/chart/Index.vue')
      },
      {
        path: '/sheet/grid',
        name: 'SheetGrid',
        component: () => import('../pages/sheet/grid/Index.vue')
      },
      {
        path: '/alarm/disposal',
        name: 'AlarmDisposal',
        component: () => import('../pages/alarm/disposal/Index.vue')
      },
      {
        path: '/alarm/grid',
        name: 'AlarmGrid',
        component: () => import('../pages/alarm/grid/Index.vue')
      }
    ]
  },

  {
    name: 'Login',
    path: '/auth/login',
    component: () => import('pages/auth/Login.vue')
  },

  {
    name: 'View',
    path: '/preview',
    component: () => import('../pages/preview/ViewItem.vue')
  },

  // Always leave this as last one,
  // but you can also remove it
  {
    path: '/:catchAll(.*)*',
    component: () => import('pages/ErrorNotFound.vue')
  }
];

export default routes;
